package com.atguigu.spring5.testdemo;

import com.atguigu.spring5.User;
import com.atguigu.spring5.bean.Emp;
import com.atguigu.spring5.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestDemo {


    @Test
    public void Test1(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean2.xml");
        UserService user = context.getBean("userService", UserService.class);
        System.out.println(user);
        user.add();
    }


    @Test
    public void Test2(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean3.xml");
        Emp emp = context.getBean("emp", Emp.class);
        System.out.println(emp);
        emp.show();
    }
}
